package com.ruoyi.project.lesson.transcodetask.service.impl;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.lesson.transcodetask.domain.TranscodeTask;
import com.ruoyi.project.lesson.transcodetask.mapper.TranscodeTaskMapper;
import com.ruoyi.project.lesson.transcodetask.service.ITranscodeTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 转码任务Service业务层处理
 *
 * @author shixiangwen
 * @date 2020-12-11
 */
@Service
@DataSource(DataSourceType.KKFORMULA)
public class TranscodeTaskServiceImpl implements ITranscodeTaskService {

    @Autowired
    private TranscodeTaskMapper transcodeTaskMapper;

    /**
     * 查询转码任务
     *
     * @param id 转码任务ID
     * @return 转码任务
     */
    @Override
    public TranscodeTask selectTranscodeTaskById(Long id) {
        return transcodeTaskMapper.selectTranscodeTaskById(id);
    }

    /**
     * 查询转码任务列表
     *
     * @param transcodeTask 转码任务
     * @return 转码任务
     */
    @Override
    public List<TranscodeTask> selectTranscodeTaskList(TranscodeTask transcodeTask) {
        return transcodeTaskMapper.selectTranscodeTaskList(transcodeTask);
    }

    /**
     * 新增转码任务
     *
     * @param transcodeTask 转码任务
     * @return 结果
     */
    @Override
    public int insertTranscodeTask(TranscodeTask transcodeTask) {
        return transcodeTaskMapper.insertTranscodeTask(transcodeTask);
    }

    /**
     * 修改转码任务
     *
     * @param transcodeTask 转码任务
     * @return 结果
     */
    @Override
    public int updateTranscodeTask(TranscodeTask transcodeTask) {
        return transcodeTaskMapper.updateTranscodeTask(transcodeTask);
    }

    /**
     * 删除转码任务对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTranscodeTaskByIds(String ids) {
        return transcodeTaskMapper.deleteTranscodeTaskByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除转码任务信息
     *
     * @param id 转码任务ID
     * @return 结果
     */
    @Override
    public int deleteTranscodeTaskById(Long id) {
        return transcodeTaskMapper.deleteTranscodeTaskById(id);
    }
}
